package lab.gene.action;

import java.util.Date;

import lab.gene.pojo.GenePlate6MP;

import lab.gene.service.impl.GenePlate6MPServiceImpl;

import com.opensymphony.xwork2.ActionSupport;

public class ViewGenePlate6MPAction extends ActionSupport{

	private static final long serialVersionUID = 1L;
	private Date recordDate = null;
	private String strain = null;
	private String intermediate = null;
	private String comments = null;
	private String geneName = null;
	private String type = null;
	
	public String execute() {
		
		String result = null;
		GenePlate6MPServiceImpl service = new GenePlate6MPServiceImpl();
		GenePlate6MP g = service.getGenePlate6MPByNameAndType(geneName, type);
		
		if (g != null) {
			recordDate = g.getRecordDate();
			strain = g.getStrain();
			intermediate = g.getIntermediate();
			comments = g.getComments();
		}
		
		switch (type) {
		case "B":
			result = "successB";
			break;
		case "C":
			result = "successC";
			break;
		case "D":
			result = "successD";
			break;
		}
		return result;
	}
	
	public Date getRecordDate() {
		return recordDate;
	}
	public void setRecordDate(Date recordDate) {
		this.recordDate = recordDate;
	}
	public String getStrain() {
		return strain;
	}
	public void setStrain(String strain) {
		this.strain = strain;
	}
	public String getIntermediate() {
		return intermediate;
	}
	public void setIntermediate(String intermediate) {
		this.intermediate = intermediate;
	}
	public String getComments() {
		return comments;
	}
	public void setComments(String comments) {
		this.comments = comments;
	}
	public String getGeneName() {
		return geneName;
	}
	public void setGeneName(String geneName) {
		this.geneName = geneName;
	}
	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}

}
